package com.azhoucode.enums;

public enum BaseErrorEnum {

    /**
     * 成功
     */
    SUCCESS(200, "成功"),

    /**
     * 普通请求异常
     */
    OBJECT_NOT_FOUND(10001, "请求数据不存在"),
    REQUEST_PARAMETER_EXCEPTION(10002, "请求参数错误"),
    PARAMETER_NOT_FOUND(10003, "必传参数缺失"),

    BAD_ACCOUNTS(10004, "手机号码有误，请重新输入"),
    BAD_CREDENTIALS(10005, "密码有误，请重新输入"),
    ACCOUNTS_DISABLED(10006, "账号不可用"),
    LOGIN_EXPIRED(10007, "登录已失效"),
    REQUIRED_AUTHENTICATION(10008, "权限不足，需要登录认证"),

    REQUIRED_ROLE(10019, "角色权限不足"),

    VALIDATE_CODE_REQUIRED(10009, "请发送短信验证码"),
    VALIDATE_CODE_EXPIRED(10010, "短信验证码已过期"),
    VALIDATE_CODE_ERROR(10011, "短信验证码不匹配"),
    VALIDATE_CODE_SEND_ERROR(10012, "短信验证码发送失败"),

    ACCESS_TOKEN_ERROR(10013, "令牌非法"),
    SUBJECT_DELETE(10014, "用户已注销"),

    MOBILE_LOGIN_ERROR(10015, "一键登录失败"),
    MOBILE_LOGIN_DECRYPT_EXCEPTION(10016, "一键登录解密异常"),
    FILE_TOO_LARGE_EXCEPTION(10017, "上传文件太大"),
    TXT_TOO_LARGE_EXCEPTION(10018, "数据太长"),

    STAFF_VALIDATE_CODE_ERROR(10019, "管家认证码不存在"),
    STAFF_VALIDATE_CODE_USED(10020, "管家认证码已使用"),

    // 4000开头客户端异常
    REQUEST_NOT_SUPPORT(40001, "请求方式不支持"),
    NO_HANDLER_EXCEPTION(40002, "没有找到请求处理器"),
    CITY_NOT_FIND_ERROR(40003, "不合法的城市参数"),
    CONDITION_NOT_MET(40004, "条件未满足"),
    NO_PERMISSION_FOR_THIS_DATA(40005, "对该数据无权限"),

    // 5000开头服务端异常
    SERVER_ERROR(50001, "服务内部异常"),
    BUSINESS_ERROR(50002, "业务错误"),


    FILE_UPLOAD_ERROR(50003, "文件上传失败"),

    LOCATION_ERROR(50004,"经纬度定位失败"),
    HOUSE_NULL(50005,"房源数据为空"),
    HOUSE_ERROR(50006,"房源数据有误"),
    RESULT_ERROR(50007,"查询的结果为空"),

    ;

    private final int code;

    private final String message;

    BaseErrorEnum(int code, String message) {
        this.code = code;
        this.message = message;

    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
